Reuseware - Adding Modularity to Your Language of Choice
نویسندگان
چکیده
syntax grammar Concrete syntax grammar Metamodel (result from mapping) Generate code Extend grammar automatically Figure 1: Grammar of Xcerpt in Reuseware The abstract and concrete syntax grammars of Xcerpt can be derived by separating concrete from abstract elements in the grammar from Listing 2. Additionally, each reference to a production rule in the abstract syntax grammar is tagged with a role name (rolename : ProductionRule). These names are then used to annotate the concrete syntax on top of the abstract structure. The production rule for GoalQueryRule (Line 5 in Listing 2), for instance, is split into an abstract and a concrete form. The abstract syntax production rule looks as follows: GoalQueryRule = goal:ConstructTerm, query:QueryTerm?; VOL 0, NO. 0 JOURNAL OF OBJECT TECHNOLOGY 13 REUSEWARE – ADDING MODULARITY TO YOUR LANGUAGE OF CHOICE This abstract syntax rule is then annotated with its concrete syntax using the notion of role names in the following manner: GoalQueryRule ::= "GOAL" goal ("FROM" query)? "END"; The Xcerpt grammars as they are used in the tool are shown in Figure 1. After the grammars of the original language have been defined in the tool, they can be extended for reuse. This extension can be done automatically or by manually adding production rules. Additional production rules are annotated to enable the tooling to identify variation points as such and address them during composition. In any case, the extended grammar is a context-free reuse grammar and the extension itself conforms to the transformation function τ (defined in Definition 3). Figure 2 visualizes the extended grammars of Xcerpt that use annotations to identify non-terminals that describe variation points. Such annotations are done in the abstract syntax grammar by repeating the rule name followed by a ==> and a predefined marker. Such markers are “componentmodel.Slot” and “componentmodel.Hook”. Abstract syntax reuse grammarsyntax reuse grammar Concrete syntax reuse grammar Separate files for core and reuse grammar Refinement of a rule defined elsewhere Generated code Figure 2: Grammar of ReuseXcerpt in Reuseware Additional production rules may be placed in a separate file. The completed extended grammar will then consist of the original grammar as modified by these additional production rules. Non-terminals defined elsewhere can be referred to using the Language.NonTerminal notation. Thus a separation between core language and reuse extension is reflected on the grammar files. Note that a concrete syntax definition has to be provided for the reuse language. However, such definitions do not have to care about which are original and which are additional rules, since the parsers handle all rules alike. 14 JOURNAL OF OBJECT TECHNOLOGY VOL 0, NO. 0 4 COMPOSITION FRAMEWORK IMPLEMENTATION
منابع مشابه
Extending grammars and metamodels for reuse: the Reuseware approach
The trend toward domain-specific languages leads to an ever-growing plethora of highly specialized languages. Developers of such languages focus on their specific domains rather than on technical challenges of language design. Generic features of languages are rarely included in special-purpose languages. One very important feature is the ability to formulate partial programs in separate encaps...
متن کاملInvestigating the Effect of Changing Answers in Multiple-Choice Questions of Reading and Listening Tests in EFL Context
This study investigates whether the practice of answer changing on multiple-choice questions (MCQs) is beneficial for Iranian students’ overall test performance in EFL context. Several studies have shown that answer changing in multiple choice examinations is generally beneficial for improving scores. On the other hand, some studies have indicated that answer changing in multiple choice examina...
متن کاملAdding Abstraction and Reuse to a Network Modelling Tool Using the Reuseware Composition Framework
Domain-specific modelling (DSM) environments enable experts in a certain domain to actively participate in model-driven development. Developing DSM environments need to be cost-efficient, since they are only used by a limited group of domain experts. Different modeldriven technologies promise to allow this cost-efficient development. [1] presented experiences in developing a DSM environment for...
متن کاملA Generic Module System for Web Rule Languages: Divide and Rule
An essential feature in practically usable programming languages is the ability to encapsulate functionality in reusable modules. Modules make large scale projects tractable by humans. For Web and Semantic Web programming, many rule-based languages, e.g. XSLT, CSS, Xcerpt, SWRL, SPARQL, and RIF Core, have evolved or are currently evolving. Rules are easy to comprehend and specify, even for non-...
متن کاملDeveloping a Model Composition Framework with Fujaba – An Experience Report
Reuseware is an open-source model composition framework for composing models defined in arbitrary Ecore-based languages. In its four years of development, Reuseware has experienced many extensions and refactorings due to the integration of new research results and requirements. One year ago, a redevelopment of Reuseware’s core was started. Thanks to its EMF code generation, Fujaba was introduce...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Journal of Object Technology
دوره 6 شماره
صفحات -
تاریخ انتشار 2007